package com.ride.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 * Entität zur Abbildung von Profilen.
 *
 * @version $LastChangedRevision: 16 $
 *          <p/>
 *          $LastChangedBy: marcel.menze@gmail.com $
 *          <p/>
 *          $LastChangedDate: 2011-04-05 12:34:26 +0000 (Tue, 05 Apr 2011) $
 */
@Entity
public class Profile implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    private String firstname;

    private String lastname;

    private String mobilePhone;

    private String phone;

    private String email;

    @ManyToOne
    @JoinColumn(name = "ADDRESS_ID")
    private Address Address;

    private Date dateOfDriverLicence;

    private Date birthday;

    private String carType;

    private Boolean smooker;

    private Boolean indirection;

    @OneToMany(mappedBy = "profile")
    private List<RideSearch> rideSearches;

    @ManyToMany
    @JoinTable(name = "RIDE_PARTICIPANT", joinColumns =
    @JoinColumn(name = "PROFILE_ID", referencedColumnName = "ID"), inverseJoinColumns =
    @JoinColumn(name = "RIDE_ID", referencedColumnName = "ID"))
    private List<Ride> rides;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Address getAddress() {
        return Address;
    }

    public void setAddress(Address address) {
        Address = address;
    }

    public Date getDateOfDriverLicence() {
        return dateOfDriverLicence;
    }

    public void setDateOfDriverLicence(Date dateOfDriverLicence) {
        this.dateOfDriverLicence = dateOfDriverLicence;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getCarType() {
        return carType;
    }

    public void setCarType(String carType) {
        this.carType = carType;
    }

    public Boolean getSmooker() {
        return smooker;
    }

    public void setSmooker(Boolean smooker) {
        this.smooker = smooker;
    }

    public Boolean getIndirection() {
        return indirection;
    }

    public void setIndirection(Boolean indirection) {
        this.indirection = indirection;
    }

    public List<RideSearch> getRideSearches() {
        return rideSearches;
    }

    public void setRideSearches(List<RideSearch> rideSearches) {
        this.rideSearches = rideSearches;
    }

    public List<Ride> getRides() {
        return rides;
    }

    public void setRides(List<Ride> rides) {
        this.rides = rides;
    }
}
